* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section, .output-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.input-section h2, .output-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

#markdownInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#markdownInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 文件上传样式 */
.file-upload-section {
    margin-bottom: 15px;
}

.file-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.file-upload-label:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.file-upload-text {
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
}

.file-name-display {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.file-name-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 16px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2d5016;
    word-break: break-all;
}

.btn-copy-filename {
    background: #28a745;
    border: 1px solid #28a745;
    color: white;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-filename:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.input-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.output-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.output-content {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    overflow-y: auto;
    max-height: 500px;
}

.placeholder {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 50px 20px;
}

.image-info {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.image-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.no-images {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.image-item {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.image-details {
    flex: 1;
    min-width: 0;
}

.image-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-top: 5px;
}

.btn-download-single {
    background: #17a2b8;
    border: 1px solid #17a2b8;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-download-single:hover {
    background: #138496;
    border-color: #117a8b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #f56565;
}

/* 解析结果的样式 */
#output h1, #output h2, #output h3, #output h4, #output h5, #output h6 {
    color: #2d3748;
    margin: 1.5em 0 0.5em 0;
    line-height: 1.2;
}

#output h1 { font-size: 2em; border-bottom: 2px solid #e2e8f0; padding-bottom: 0.3em; }
#output h2 { font-size: 1.5em; }
#output h3 { font-size: 1.17em; }

#output p {
    margin: 1em 0;
    line-height: 1.6;
}

#output img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 10px 0;
}

#output ul, #output ol {
    margin: 1em 0;
    padding-left: 2em;
}

#output li {
    margin: 0.5em 0;
}

#output blockquote {
    border-left: 4px solid #667eea;
    margin: 1em 0;
    padding: 0.5em 1em;
    background: #f8f9ff;
    font-style: italic;
}

#output code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

#output pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

#output pre code {
    background: none;
    padding: 0;
    color: inherit;
}

#output table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

#output th, #output td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}

#output th {
    background: #f7fafc;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .output-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .output-buttons {
        justify-content: center;
    }
    
    .image-list {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section, .output-section, .image-info {
        padding: 20px;
    }
    
    .file-upload-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .file-upload-label {
        text-align: center;
        justify-content: center;
    }
    
    .file-upload-text {
        text-align: center;
    }
    
    .file-name-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .btn-copy-filename {
        font-size: 11px;
        padding: 5px 10px;
        margin-top: 5px;
    }
    
    .btn-download-single {
        font-size: 10px;
        padding: 5px 8px;
        margin-top: 5px;
    }
    
    .image-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .image-preview {
        align-self: center;
    }
} 